package com.atguigu.gulimall.coupon.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Author : Jungle
 * @Description :
 */
@Configuration
@EnableTransactionManagement  //开启事物
public class MybatisConfig {
    //引入分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //请求页面大于最大页面操作，true跳回首页，false继续请求
        paginationInterceptor.setOverflow(true);
        //设置最大单页限制数量，默认为500，-1不受限制
        paginationInterceptor.setLimit(10);
        return paginationInterceptor;
    }
}
